/*
 * @Author: shawnxiao
 * @Date: 2021-11-12 16:16:51
 * @LastEditTime: 2021-11-12 17:15:07
 * @FilePath: /gatt-react/src/components/DrawerCom/index.tsx
 */
import React from 'react'
import { Button, Drawer, Space } from 'antd'
function DrawerCom(props:any) {
  const {
    visible, onClose, title = '新建', width = 350,
    headerStyle = {padding: '10px 24px'},
    bodyStyle = {padding: '15px'}, onSaveDrawer
  } = props

  return (
    <Drawer
    title={title}
    width={width}
    onClose={onClose}
    visible={visible}
    bodyStyle={bodyStyle}
    headerStyle={headerStyle}
    extra={
      <Space>
        <Button onClick={onClose} size="small">取消</Button>
        <Button onClick={onSaveDrawer} size="small" type="primary">
          保存
        </Button>
      </Space>
    }
  >
    {props.children}
  </Drawer>
  )
}

export default DrawerCom
